﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using FirstFloor.ModernUI.App.Content;
using FirstFloor.ModernUI.Windows.Controls;

namespace FirstFloor.ModernUI.App.Pages.login
{
    /// <summary>
    /// Interaction logic for Introduction.xaml
    /// </summary>
    public partial class login2 : UserControl
    {
        public login2()
        {
            InitializeComponent();
            btn_lgn.MouseEnter += btn_lgn_MouseEnter;
            btn_lgn.MouseLeave += btn_lgn_MouseLeave;
            btn_cncl.MouseEnter += btn_cncl_MouseEnter;
            btn_cncl.MouseLeave += btn_cncl_MouseLeave;

        }


        private void btn_lgn_Click(object sender, RoutedEventArgs e)
        {

            if (txt_name.Text == "" && txt_password.Password == "")
            {
                
                Presentation.Link link = new Presentation.Link();
                link.DisplayName = "fff";
                link.Source = new Uri("/Pages/Introduction.xaml", UriKind.Relative);
                
                MainWindow main = new MainWindow();
                Presentation.LinkGroup lnk = new Presentation.LinkGroup();
                lnk.DisplayName = "aaaaaaaaaaaa";
                lnk.Links.Add(link);
                
                
               
                main.MenuLinkGroups.Add(lnk);
                 
                main.TitleLinks.Add(link);
                
                //main.MenuLinkGroups.Add(lnk);
                main.Show();
               
                App.Current.MainWindow.Close();
               
            }
            else
            {




                var wnd = new ModernWindow
                {
                    Style = (Style)App.Current.Resources["EmptyWindow"],
                    Content = new loginerror
                    {
                        Margin = new Thickness(32)
                    },
                    Width = 400,
                    Height = 350
                };
                wnd.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                wnd.Topmost = true;

                wnd.ShowDialog();

                //MessageBox.Show("incorect name or password");
            }
            
            
        }


        void btn_lgn_MouseEnter(object sender, MouseEventArgs e)
        {

            employers_image_Copy.Height = 52;
            employers_image_Copy.Width = 55;
            employers_image_Copy.Margin = new Thickness(328,282,0,0);

        }


        void btn_lgn_MouseLeave(object sender, MouseEventArgs e)
        {
            
            employers_image_Copy.Height = 71;
            employers_image_Copy.Width = 72;
            employers_image_Copy.Stretch = Stretch.Uniform;
            employers_image_Copy.Margin = new Thickness(312, 270, 0, 0);
        }


        private void btn_invoice_Copy_Click(object sender, RoutedEventArgs e)
        {
            
        }

        private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
           
        }

        private void btn_cncl_Click(object sender, RoutedEventArgs e)
        {
            
        }

        void btn_cncl_MouseLeave(object sender, MouseEventArgs e)
        {
            cncl_image.Height = 71;
            cncl_image.Width = 72;
            cncl_image.Stretch = Stretch.Uniform;
            cncl_image.Margin = new Thickness(59, 270, 0, 0);
        }

        void btn_cncl_MouseEnter(object sender, MouseEventArgs e)
        {

            cncl_image.Height = 56;
            cncl_image.Width = 47;
            cncl_image.Margin = new Thickness(76, 286, 0, 0);
        }




    }
}
